import React, { FC, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { Button, Typography } from "antd";
import { LOGIN_PATHNAME } from "../router";

import styles from "./Home.module.scss";
const { Title, Paragraph } = Typography;
const Home: FC = () => {
  
useEffect(()=>{
    fetch('/api/test').then(res=>{console.log(res,'res')}).then(data=>{console.log(data,'data')})
})
  const nav = useNavigate();
  function clickHandler() {
    nav(LOGIN_PATHNAME);
  }
  return (
    <div className={styles.container}>
      <div className={styles.info}>
        <Title> 问卷调查 ｜ 在线投票</Title>
        <Paragraph>
          已累计创建问卷 100 份，发布问卷 90份，收到答案1800+份
        </Paragraph>
        <div>
          <Button onClick={() => clickHandler()} type="primary" size="large">
            开始使用
          </Button>
        </div>
      </div>
    </div>
  );
};
export default Home;
